<template lang="pug">
  keep-alive
    kalix-table(bizKey="carousel" title='轮播' ref="kalixTable"
    v-bind:tableFields="tableFields"
    v-bind:targetURL="carouselURL"
    v-bind:bizDialog="carouselDialog"
    v-bind:btnList="carouselBtnList"
    v-bind:buttonPermissionPrefix="buttonPermissionPrefix"
    v-bind:toolbarBtnList="toolbarBtnList"
    bizSearch="carouselSearch")
      template(slot="tableColumnSlot")
        el-table-column(prop="url"  label="url")
        el-table-column(prop="photo"  label="图片")
          template(slot-scope="scope")
            img(:src="scope.row.photo" width="93px" readonly="readonly")
            <!--kalix-img-upload(v-model="scope.row.photo" readonly="readonly")-->
</template>

<script type="text/ecmascript-6">
  import {MpliveCarouselURL, carouselBtnPermissionPrefix} from '../../config.toml'
  import {carouselConfigBtnList} from './config'
  import KalixTable from '../../../../../components/corelib/components/common/baseTable'
  import KalixImgUpload from '../../../../../components/corelib/components/common/imgUpload'

  export default {
    name: 'kalix-mplive-carousel',
    components: {KalixImgUpload, KalixTable},
    data() {
      return {
        carouselURL: MpliveCarouselURL,
        tableFields: [
          {prop: 'url', label: 'url'},
          {prop: 'photo', label: '图片'}
        ],
        carouselDialog: [
          {id: 'add', dialog: 'CarouselAdd'},
          {id: 'view', dialog: 'CarouselView'}
          // {id: 'edit', dialog: 'CarouselEdit'}
        ],
        carouselBtnList: carouselConfigBtnList,
        buttonPermissionPrefix: carouselBtnPermissionPrefix,
        toolbarBtnList: [
          {id: 'add', isShow: true, title: '添加', isPermission: true}
        ]
      }
    }
  }
</script>

<style scoped lang="stylus">
  .table-content
    overflow hidden
    height 28px
    text-overflow ellipsis
    white-space nowrap

</style>
